#include "landblockcontent.h"
LandBlockContent::LandBlockContent(QWidget *parent) : QLabel(parent)
{
    this->setAutoFillBackground(true);
    this->setPalette(QPalette(Qt::white));
    this->resize(parent->size());
    connect(this, &LandBlockContent::landMinesCountChanged, this, &LandBlockContent::displayLandMineCount);
}

void LandBlockContent::displayLandMineCount()
{
    QString count = "%1";
    this->setText(count.arg(landMinesCount));
}

int LandBlockContent::getLandMinesCount() const
{
    return landMinesCount;
}

void LandBlockContent::setLandMinesCount(int newLandMinesCount)
{
    if (landMinesCount == newLandMinesCount)
        return;
    landMinesCount = newLandMinesCount;
    emit landMinesCountChanged();
}

void LandBlockContent::resetLandMinesCount()
{
    setLandMinesCount({}); // TODO: Adapt to use your actual default value
}
